import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'

import Home from '@/views/home/index'


Vue.use(Router)

import Layout from '../views/layout/Layout'

export const constantRouterMap = [
  {path: '/acceptStore', component: () => import('@/views/login/acceptStore'), hidden: true},
  {path: '/login', component: () => import('@/views/login/index'), hidden: true},
  {path: '/404', component: () => import('@/views/404'), hidden: true},
  // {
  //   path: '/',
  //   name: 'HelloWorld',
  //   component: HelloWorld
  // },
  {
    path: '/',
    component: Layout,
    redirect: '/sys/admin',
    children: [{
      path: 'index',
      name: 'index',
      component: () => import('@/views/home/index'),
      meta: {title: '首页', icon: 'home'}
    }]
  },
 

  {
    path: '/study',
    component: Layout,
    name: 'study',
    meta: {title: '演示案例', icon: 'home'},  
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/study/index'),
        meta: {title: '表格示例', icon: 'product-list'}
      }, 
      {
        path: 'form',
        name: 'form',
        component: () => import('@/views/study/form'),
        meta: {title: '表格示例', icon: 'product-list'}
      },
      {
        path: 'echart_demo1',
        name: 'echart_demo1',
        component: () => import('@/views/study/echart_demo1'),
        meta: {title: '表格示例', icon: 'product-list'}
      },
    ]
  },


  {
    path: '/interview',
    component: Layout,
    name: 'interview',
    meta: {title: '面试管理', icon: 'home'},
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/interview/index'),
        meta: {title: '面试管理查询', icon: 'product-list'}
      },  
      {
        path: 'add',
        name: 'add',
        component: () => import('@/views/interview/add'),
        meta: {title: '新增面试', icon: 'product-list'}
      },  
      {
        path: 'Query',
        name: 'Query',
        component: () => import('@/views/interview/Query'),
        meta: {title: '查询面试', icon: 'product-list'}
      }, 
      {
        path: 'dict',
        name: 'dict',
        component: () => import('@/views/interview/dict'),
        meta: {title: '字典管理', icon: 'product-list'}
      },
      {
        path: 'dictCopy',
        name: 'dictCopy',
        component: () => import('@/views/interview/dictCopy'),
        meta: {title: '字典管理原表', icon: 'product-list'}
      },
    ]
  },

  {
    path: '/worklog',
    component: Layout,
    name: 'worklog',
    meta: {title: '日志管理', icon: 'home'},
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/worklog/index'),
        meta: {title: '日志管理', icon: 'product-list'}
      },
      {
        path: 'redact',
        name: 'redact',
        component: () => import('@/views/worklog/redact'),
        meta: {title: '日志编辑', icon: 'product-list'}
      },
    ]
  },

   
 
 

  {
    path: '/sys',
    component: Layout,
    // redirect: '/sys/admin',
    name: 'sys',
    meta: {title: '系统管理', icon: 'home'},
    children: [
      {
        path: 'admin',
        name: 'admin',
        component: () => import('@/views/sys/admin/index'),
        meta: {title: '用户列表', icon: 'product-list'}
      },
      {
        path: 'userCommunity',
        name: 'userCommunity',
        component: () => import('@/views/sys/admin/userCommunity'),
        meta: {title: '绑定', icon: 'product-list'}
      },
      {
        path: 'addAdmin',
        name: 'addAdmin',
        component: () => import('@/views/sys/admin/add'),
        meta: {title: '添加用户'},
        hidden: true
      },
      {
        path: 'updateAdmin',
        name: 'updateAdmin',
        component: () => import('@/views/sys/admin/update'),
        meta: {title: '编辑用户'},
        hidden: true
      },
      {
        path: 'permissionCategory',
        name: 'permissionCategory',
        component: () => import('@/views/sys/permissionCategory/index'),
        meta: {title: '菜单类别列表}'}
      },
      {
        path: 'addPermissionCategory',
        name: 'addPermissionCategory',
        component: () => import('@/views/sys/permissionCategory/add'),
        meta: {title: '添加菜单类别', icon: 'permissionCategory-add'},
        hidden: true
      },
      {
        path: 'updatePermissionCategory',
        name: 'updatePermissionCategory',
        component: () => import('@/views/sys/permissionCategory/update'),
        meta: {title: '修改菜单类别', icon: 'permissionCategory-update'},
        hidden: true
      },
      {
        path: 'permission',
        name: 'permission',
        component: () => import('@/views/sys/permission/index'),
        meta: {title: '权限列表', icon: 'product-list'}
      },
      {
        path: 'addPermission',
        name: 'addPermission',
        component: () => import('@/views/sys/permission/add'),
        meta: {title: '添加权限'},
        hidden: true
      },
      {
        path: 'updatePermission',
        name: 'updatePermission',
        component: () => import('@/views/sys/permission/update'),
        meta: {title: '编辑权限'},
        hidden: true
      },
      {
				path: 'role',
				name: 'role',
				component: () => import('@/views/sys/role/index'),
				meta: {
					title: '角色列表',
					icon: 'product-list'
				}
			},
			{
				path: 'addRole',
				name: 'addRole',
				component: () => import('@/views/sys/role/add'),
				meta: {
					title: '添加角色'
				},
				hidden: true
			},
			{
				path: 'updateRole',
				name: 'updateRole',
				component: () => import('@/views/sys/role/update'),
				meta: {
					title: '编辑角色'
				},
				hidden: true
			},

			
      {
        path: 'sysOrg',
        name: 'sysOrg',
        component: () => import('@/views/sys/sysOrg/index'),
        meta: {title: '管理列表', icon: 'product-list'}
        },
        
        {
        path: 'addSysOrg',
        name: 'addSysOrg',
        component: () => import('@/views/sys/sysOrg/add'),
        meta: {title: '添加管理'},
        hidden: true
        },
        {
        path: 'updateSysOrg',
        name: 'updateSysOrg',
        component: () => import('@/views/sys/sysOrg/update'),
        meta: {title: '编辑管理'},
        hidden: true
        },

      // {
      //   path: 'appversion',
      //   name: 'appversion',
      //   component: () => import('@/views/sys/version/index'),
      //   meta: {title: '版本管理列表', icon: 'product-list'}
      // },

    ]
  },
  
  {
    path: '/demo',
    component: Layout,
    name: 'demo',
    meta: {title: '演示案例', icon: 'home'},  
    children: [
      {
        path: 'table',
        name: 'table',
        component: () => import('@/views/demo/table/index'),
        meta: {title: '表格示例', icon: 'product-list'}
      },
      {
        path: 'demo',
        name: 'demo',
        component: () => import('@/views/demo/demo/index'),
        meta: {title: 'demo1', icon: 'product-list'}
      },
      {
        path: 'upload',
        name: 'upload',
        component: () => import('@/views/demo/upload'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo1',
        name: 'demo1',
        component: () => import('@/views/demo/demo1/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo2',
        name: 'demo2',
        component: () => import('@/views/demo/demo2/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo3',
        name: 'demo3',
        component: () => import('@/views/demo/demo3/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo4',
        name: 'demo4',
        component: () => import('@/views/demo/demo4/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo5',
        name: 'demo5',
        component: () => import('@/views/demo/demo5/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo6',
        name: 'demo6',
        component: () => import('@/views/demo/common'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'demo8',
        name: 'demo8',
        component: () => import('@/views/demo/demo8/index'),
        meta: {title: 'upload', icon: 'product-list'}
      },      
      {
        path: 'demo8form',
        name: 'demo8form',
        component: () => import('@/views/demo/demo8/form'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'form1',
        name: 'form1',
        component: () => import('@/views/demo/form-quill/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
      {
        path: 'form2',
        name: 'form2',
        component: () => import('@/views/demo/form-tinymce/Index'),
        meta: {title: 'upload', icon: 'product-list'}
      },
   

    ]
  },
 
  {
    path: '/menu',
    name: 'menu',
    component: () => import('@/views/demo/menu/Index'),
    meta: {title: 'demo', icon: 'product-list'},
    children: [
        {
          path: 'demo1',
          name: 'demo1',
          component: () => import('@/views/demo/menu/demo1'),
          meta: {title: 'demo1', icon: 'product-list'}
        },
        {
          path: 'demo2',
          name: 'demo2',
          component: () => import('@/views/demo/menu/demo2'),
          meta: {title: 'demo2', icon: 'product-list'}
        },
        {
          path: 'demo3',
          name: 'demo3',
          component: () => import('@/views/demo/menu/demo3'),
          meta: {title: 'demo3', icon: 'product-list'}
        }, 
        {
          path: 'demo4',
          name: 'demo4',
          component: () => import('@/views/demo/menu/router'),
          meta: {title: 'demo', icon: 'product-list'}
        }, 
    ]
  },
  {
    path: '/pms',
    component: Layout, 
    name: 'pms',
    meta: {title: '商品管理', icon: 'home'},  
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/pms/pmsProduct/index'),
        meta: {title: '商品列表', icon: 'product-list'}
      },
      {
        path: 'add',
        name: 'add',
        component: () => import('@/views/pms/pmsProduct/add'),
        meta: {title: '新增', icon: 'product-list'}
      },
    ]
  },
  {
    path: '/taskCore',
    component: Layout,
    redirect: '/taskCore/index',
    name: 'taskCore',
    meta: {title: '任务中心', icon: 'home'},
    children: [
      {
        path: 'index',
        name: 'index',
        component: () => import('@/views/activiti/creatTask/index'),
        meta: {title: '任务中心', icon: 'product-list'}
      },
      {
        path: 'addTaskBill',
        name: 'addTaskBill',
        component: () => import('@/views/activiti/creatTask/add'),
        meta: {title: '添加任务', icon: 'product-list'}
      },
      {
        path: 'findTask',
        name: 'findTask',
        component: () => import('@/views/activiti/creatTask/add'),
        meta: {title: '添加任务', icon: 'product-list'}
      },
      {
        path: 'findUndoTask',
        name: 'findUndoTask',
        component: () => import('@/views/activiti/creatTask/add'),
        meta: {title: '添加任务', icon: 'product-list'}
      },
      {
        path: 'findDoneTask',
        name: 'findDoneTask',
        component: () => import('@/views/activiti/creatTask/add'),
        meta: {title: '添加任务', icon: 'product-list'}
      },
    ]
  },
  // {
  //   path: '/app',
  //   component: Layout,
  //   redirect: '/app/appversion',
  //   name: 'app',
  //   meta: {title: 'APP管理', icon: 'home'},
  //   children: [{
  //       path: 'appversion',
  //       name: 'appversion',
  //       component: () => import('@/views/app/version/index'),
  //       meta: {title: '版本管理列表', icon: 'product-list'}
  
  //   },
  //   {
  //     path: 'addVersion',
  //     name: 'addVersion',
  //     component: () => import('@/views/app/version/add'),
  //     meta: {title: '添加新版本'},
  //     hidden: true
  //   }
  // ]
  // }

]



export const asyncRouterMap = [
  {
    path: '/pms',
    component: Layout,
    redirect: '/pms/product',
    name: 'pms',
    meta: {title: '商品', icon: 'product'},
    },

  {path: '*', redirect: '/404', hidden: true}
]



export default new Router({
  // mode: 'history', //后端支持可开
  scrollBehavior: () => ({y: 0}),
  routes: constantRouterMap
})
